const validateBanner = async (ctx, next) => {
    // 验证商品信息
    try {
        ctx.verifyParams({
            bannername: { type: 'string', required: true },
            url: { type: 'string', required: true },
        })
    } catch (err) {
        ctx.body = {
            code: 500,
            message: '参数错误',
            data: err
        }
        return
    }
    await next()
}

const PageSizeOrPage = async (ctx, next) => {
    try {
        ctx.verifyParams({
            pageSize: { type: 'number', required: true },
            page: { type: 'number', required: true },
        })
    } catch (err) {
        ctx.body = {
            code: 500,
            message: '参数错误',
            data: err
        }
        return
    }
    await next()
}
module.exports = {
    validateBanner,
    PageSizeOrPage
}